package com.g4.shoppingsingle.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.g4.shoppingsingle.mapper.DdSubOrderInfoMapper;
import com.g4.shoppingsingle.pojo.DdSubOrderInfo;
import com.g4.shoppingsingle.service.IDdSubOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单明细表 服务实现类
 * </p>
 *
 * @author admin
 * @since 2021-10-27
 */
@Service
public class DdSubOrderInfoServiceImpl extends ServiceImpl<DdSubOrderInfoMapper, DdSubOrderInfo> implements IDdSubOrderInfoService {
    @Autowired
    private DdSubOrderInfoMapper ddSubOrderInfoMapper;

    /**
     * 获取订单明细信息
     * @param orderId
     * @return
     */
    @Override
    public List<DdSubOrderInfo> getSubOrder(Integer orderId) {
        QueryWrapper<DdSubOrderInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("or_id",orderId);
        List<DdSubOrderInfo> subOrders=ddSubOrderInfoMapper.selectList(queryWrapper);
        return subOrders;
    }
}
